package android.game;

import java.io.DataInputStream;
import java.io.InputStream;

import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class ContractPNG{
	public static byte[] imgArray(){
		byte[] b = null;
		AssetManager assets = MainActivity.activity.getAssets();
		try {
			InputStream is = assets.open("bin/sample.bin");
			DataInputStream dis = new DataInputStream(is);
			b = new byte[dis.readInt()];
			dis.read(b);
		}catch(Exception e){
		}
		return b;
	}
	
	public static Bitmap load(){
		Bitmap img = null;
		byte[] imgArray = imgArray();
		img = BitmapFactory.decodeByteArray(imgArray, 0, imgArray.length);
		return img;
	}
}
